package com.cxb;

import android.os.Bundle;
import android.view.View;

import com.cxb.utils.SharedPreferencesUtils;
import com.cxb.view.GsensorBallView;

public class GensorActivity extends BaseActivity {

	private GsensorBallView gSensorBall;
	private SharedPreferencesUtils sharedPreferencesUtils;

	@Override
	protected void onCreate(Bundle savedInstanceState) {

		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_gsensor);

		gSensorBall = (GsensorBallView) findViewById(R.id.gsensor_ball);
		sharedPreferencesUtils = new SharedPreferencesUtils(this);
		// CxbEventBus.resgist(CxbEventBus.EVENT_GSENSOR_CHANGE, this);
	}

	// public void onEventMainThread(Gsensor gsensor) {
	// gSensorBall.updateGsensorStatus(gsensor);
	// }
	@Override
	protected void onDestroy() {
		// CxbEventBus.unResgist(CxbEventBus.EVENT_GSENSOR_CHANGE, this);
		super.onDestroy();
	}

	public void btn_clear(View view) {
		sharedPreferencesUtils.setGsensorAccCount(0);
		sharedPreferencesUtils.setGsensorDecCount(0);
		sharedPreferencesUtils.setGsensorTurnLeftCount(0);
		sharedPreferencesUtils.setGsensorTurnRightCount(0);
	}

}
